<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="signupForm">
							<div class="form-group">
								<input id="id" name="id" th:value="${software.id}"  type="hidden">
								<input id="status" name="status" value="1"  type="hidden">
								<label class="col-sm-2 control-label">扫码查询：</label>
								<div class="col-sm-4">
									<input id="ssn" name="ssn"  onchange="approvals()" class="form-control" type="text">
								</div>
							</div>
							<div class="form-group">	
								<label class="col-sm-2 control-label">交件日期：</label>
								<div class="col-sm-4">
									<div class="input-group date" id='date1'>
										<input id="submitDate" name="submitDate" th:value="${software.submitDate}" placeholder="2019-01-01" type="text" class="form-control">
										<span class="input-group-addon">
												<i class="glyphicon glyphicon-calendar"></i>
											</span>
									</div>
								</div>
								<label class="col-sm-2 control-label">流水号：</label>
								<div class="col-sm-4">
									<input id="sn" name="sn" th:value="${software.sn}"  class="form-control" type="text">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">业务类型：</label>
								<div class="col-sm-4">
									<select id="businessType" name="businessType" class="selectpicker" style="width:100%;height:34px">
										<option th:selected="(${software.businessType}==0)" value="0">新登记</option>
										<option th:selected="(${software.businessType}==1)" value="1">转让</option>
										<option th:selected="(${software.businessType}==2)" value="2">变更</option>
										<option th:selected="(${software.businessType}==3)" value="3">查询</option>
										<option th:selected="(${software.businessType}==4)" value="4">撤回</option>
									</select>
								</div>

								<label class="col-sm-2 control-label">代理公司：</label>
								<div class="col-sm-4">
									<select id="agentCompany" name="agentCompany" class="selectpicker" style="width:100%;height:34px">
										<option selected value="-1">请选择代理公司</option>
										<option th:each="agent:${agentList}"  th:selected="(${software.agentCompany}==${agent.name})" th:value="${agent.name}" th:text="${agent.name}"></option>
									</select>
								</div>

							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">著作权人：</label>
								<div class="col-sm-4">
									<textarea id="copyrightOwner" style="width:100%;" name="copyrightOwner" th:text="${software.copyrightOwner}" rows="3"></textarea>
								</div>

								<label class="col-sm-2 control-label">作品名称：</label>
								<div class="col-sm-4">
									<textarea id="softwareName" style="width:100%;" name="softwareName" th:text="${software.softwareName}" rows="3"></textarea>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">业务员：</label>
								<div class="col-sm-4">
									<select id="businessMan" name="businessMan" class="selectpicker" style="width:100%;height:34px">
										<option value="-1" selected>请选择业务员</option>
										<option th:each="user:${userList}" th:selected="(${user.userId}==${software.businessMan})"   th:value="${user.userId}" th:text="${user.name}"></option>
									</select>
								</div>

								<label class="col-sm-2 control-label">出证日期：</label>

								<div class="col-sm-4">
									<div class="input-group date" id='date2'>
										<input id="approvalDate" name="approvalDate" th:value="${software.approvalDate}"  placeholder="2019-01-01" type="text" class="form-control">
										<span class="input-group-addon">
												<i class="glyphicon glyphicon-calendar"></i>
											</span>
									</div>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">是否系列：</label>
								<div class="col-sm-4">
									<label class="radio-inline"> <input type="radio" th:field="*{software.type}"  name="type" value="1" /> 是</label>
									<label class="radio-inline"> <input type="radio" th:field="*{software.type}"  name="type" value="0" /> 否</label>
								</div>
								<label class="col-sm-2 control-label">撤回流水号：</label>
								<div class="col-sm-4">
									<input id="backsn" name="backsn" th:value="${software.backsn}"  class="form-control" type="text">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">工作日：</label>
								<div class="col-sm-4">
									<select id="workDays" name="workDays" class="selectpicker" style="width:100%;height:34px">
										<option value="0">普件</option>
										<option value="31" selected>31工作日</option>
										<option value="26">26-30工作日</option>
										<option value="21">21-25工作日</option>
										<option value="16">16-20工作日</option>
										<option value="11">11-15工作日</option>
										<option value="6">6-10工作日</option>
										<option value="5">5工作日</option>
										<option value="4">4工作日</option>
										<option value="3">3工作日</option>
										<option value="2">2工作日</option>
										<option value="1">1工作日</option>
									</select>
								</div>
								<label class="col-sm-2 control-label">原价（折前价）：</label>
								<div class="col-sm-4">
									<input id="price" name="price" value="300" class="form-control" type="text">
								</div>


							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">补正：</label>
								<div class="col-sm-4">
									<label class="radio-inline"> <input type="radio" th:field="*{software.needSupp}"  name="needSupp" onclick="supp()" value="1" /> 是</label>
									<label class="radio-inline"> <input type="radio" th:field="*{software.needSupp}"  name="needSupp" onclick="unsupp()" value="0" /> 否</label>
								</div>
							</div>
							<div  id="supp1"  style="display: none;">
								<div class="form-group">
									<label class="col-sm-2 control-label">补正日期：</label>
									<div class="col-sm-4">
										<div class="input-group date" id='date3'>
											<input id="suppDate" name="suppDate"  th:value="${software.submitDate}" placeholder="2019-01-01" type="text" class="form-control">
											<span class="input-group-addon">
													<i class="glyphicon glyphicon-calendar"></i>
												</span>
										</div>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label">补正原因及过程：</label>
									<div class="col-sm-10">
										<textarea id="suppReason" th:text="${software.suppReason}"   style="width:100%;" name="suppReason" rows="12"></textarea>
									</div>
								</div>

							</div>
		<!--					<div class="form-group">
								<label class="col-sm-2 control-label">状态：</label>
								<div class="col-sm-10">
									<input id="status" name="status" class="form-control" type="text">
								</div>
							</div>-->
							<div class="form-group">
								<label class="col-sm-2 control-label">特殊情况备注：</label>
								<div class="col-sm-10">
									<textarea id="comments" style="width:100%;" th:text="${software.comments}"   name="comments" rows="8"></textarea>

								</div>
							</div>
							<div class="form-group">
								<div class="col-sm-8 col-sm-offset-3">
									<button type="submit" class="btn btn-primary">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
	</div>
	</div>
	<div th:include="include::footer"></div>
	<script type="text/javascript" src="/js/appjs/banquan/software/approvals.js">
	</script>
	<script>
		$(function () {
			$('#date1').datetimepicker({
				format: 'YYYY-MM-DD',
				locale: moment.locale('zh-cn')
			});
		});
	</script>
	<script>
		$(function () {
			$('#date2').datetimepicker({
				format: 'YYYY-MM-DD',
				locale: moment.locale('zh-cn')
			});
		});
	</script>
	<script>
		$(function () {
			$('#date3').datetimepicker({
				format: 'YYYY-MM-DD',
				locale: moment.locale('zh-cn')
			});
		});
	</script>
	<script>
		function supp() {
			document.getElementById("supp1").style.display="";
		}
		function unsupp() {
			document.getElementById("supp1").style.display="none";
		}

		$("#workDays").on("change",function(){
			workDay = $("option:selected",this).val();//
			switch (workDay) {
				case '31':price=300;break;
				case '26':price=400;break;
				case '21':price=700;break;
				case '16':price=1000;break;
				case '11':price=1500;break;
				case '6':price=2000;break;
				case '5':price=3000;break;
				case '4':price=4000;break;
				case '3':price=5000;break;
				case '2':price=10000;break;
				case '1':price=20000;break;
				default:price=0;

			}
			document.getElementById("price").value=price;
		});
	</script>
</body>
</html>
